package rs.dalao.syc.passport.security;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Component;

import java.util.Collection;
@Getter
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class CustomUserDetails  extends User {
    private Long id;
    private Long role;
    private String avatar;
    private String name;
    public CustomUserDetails( Long id,
                              Long role,
                              String avatar,
                              String username,
                              String name,
                              String password,
                              boolean enabled,
                              Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, true, true, true, authorities);
        this.id=id;
        this.role = role;
        this.avatar = avatar;
        this.name=name;
    }
}
